using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Cmc.Modbus.Base
{
    public abstract class IClient
    {

        public string IP { get; set; }
        public int Port { get; set; }
        public bool IsConnected { get; set; }
        public abstract bool SendBytes(byte[] bytes);
        public abstract byte[] RecieveBytes();

        /// <summary>
        /// 发送命令并接受数据
        /// </summary>
        /// <param name="sendBytes"></param>
        /// <returns></returns>
        public abstract byte[] RecieveBytes(byte[] sendBytes);

        public Action<byte[]> OnRecive;

    }
}
